package com.abou.mvc.core;

import org.springframework.context.MessageSource;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.ui.context.support.ResourceBundleThemeSource;

/**
 * @author ztrt8431
 */
public class CustomResourceBundleThemeSource extends ResourceBundleThemeSource {
  
  /**
   * @see org.springframework.ui.context.support.ResourceBundleThemeSource#createMessageSource(java.lang.String)
   */
  @Override
  protected MessageSource createMessageSource(String basename) {

    ResourceBundleMessageSource messageSource =
        new ResourceBundleMessageSource();
    messageSource.setBasenames(new String[] { basename + ".base",
        basename + ".common", basename + ".enum", basename + ".exception",
        basename + ".fields", basename + ".pages", basename + ".validation", });
    
    return messageSource;
  }
}
